//
//  FKOrderGoods.m
//  WanTao
//
//  Created by Macbook Pro on 2019/3/22.
//  Copyright © 2019 Macbook Pro. All rights reserved.
//

#import "FKOrderGoods.h"
#import "FKOperationBtnStatus.h"

@implementation FKOrderGoods

+ (NSDictionary *)mj_objectClassInArray
{
    return @{@"btnStatuses" : [FKOperationBtnStatus class]
             };
}

- (void)mj_keyValuesDidFinishConvertingToObject
{
    NSMutableArray *array = [NSMutableArray array];
    if (_btn_arr.count > 0) {
        if ([_btn_arr[@"write_off"] boolValue]) {
//            [array addObject:[FKOperationBtnStatus statusWith:@"核销" themeColor:fkMainColor]];
            FKOperationBtnStatus *status = [FKOperationBtnStatus statusWith:@"核销" themeColor:fkMainColor];
            status.disable = [fkFORMAT(@"%@", _btn_arr[@"write_off"]) isEqualToString:@"2"];
            [array addObject:status];
        }
        if ([_btn_arr[@"make_an_appointment"] boolValue]) {
            FKOperationBtnStatus *status = [FKOperationBtnStatus statusWith:@"预约" themeColor:fkColor333333];
            status.disable = [fkFORMAT(@"%@", _btn_arr[@"make_an_appointment"]) isEqualToString:@"2"];
            [array addObject:status];
        }
        if ([_btn_arr[@"apply_after_sale"] boolValue]) {
            [array addObject:[FKOperationBtnStatus statusWith:@"退款" themeColor:fkColor333333]];
        }
    }
    _btnStatuses = array;
}

@end
